package tank;

public class TankAssembly implements IAssemblyLine {
	
	private BodyBuilding bodyBuilding;
	private EngineBuilding engineBuilding;
	private TurretBuilding turretBuilding;

	
	
	public TankAssembly(BodyBuilding bodyBuilding,
			EngineBuilding engineBuilding, TurretBuilding turretBuilding) {
		
		this.bodyBuilding = bodyBuilding;
		this.engineBuilding = engineBuilding;
		this.turretBuilding = turretBuilding;
	}



	public IProduct assembleProduct(IProduct tank) {
		Body body = bodyBuilding.buildProductPart();
		Engine engine = engineBuilding.buildProductPart();
		Turret turret =  turretBuilding.buildProductPart();
		
		tank.installFirstPart(body); 
		tank.installSecondPart(engine);
		tank.installThirdPart(turret);
		
		System.out.println("Assembly is finiched");
		return tank;
	}


	

	
	

}
